#-------------------------------------------------------------------------------
# Name:        module1
# Purpose:
#
# Author:      Michael Boesch
#
# Created:     30.08.2010
# Copyright:   (c) Michael Boesch 2010
# Licence:     <your licence>
#-------------------------------------------------------------------------------
#!/usr/bin/env python
import pickle

class Person:
   def __init__(self, name, age):
      self.name = name
      self.age = age

   def getName(self):
      return self.name

   def getAge(self):
      return self.age

person = Person('Monica', 15)
print person.getName()
print person.getAge()

f = open('monica', 'w')
pickle.dump(person, f)
f.close()

f = open('monica', 'r')
monica = pickle.load(f)
f.close()

print monica.getName()
print monica.getAge()
